package br.ufrgs.tsp.model;

/**
 * Sequence generator used to create a city identifier (sequence identifier).
 * @author mineiro
 *
 */
public class SequenceGenerator {
	
	/**
	 * Current sequence value.
	 */
	private int sequence = 0;

	
	/**
	 * Gets the next sequence for a city id.
	 * @return
	 */
	public synchronized int getNextSequence() {
		return this.sequence++;
	}
	
	public synchronized void clearSequences() {
		this.sequence = 0;
	}
}
